<?php
require_once 'C:\wamp\www\projet_symfony\app_clinique\lib\fpdf/fpdf.php';

$pdf=new FPDF();
$pdf->setMargins(20,20);
$pdf->AddPage();
$pdf->SetFont('Arial','',11);
$pdf->Cell(40,5,'Docteur '.$user->getNom().' '.$user->getPrenom());
$pdf->Cell(40,5,$user->getAdresse(),0,1);
$pdf->Cell(40,5,$user->getCompltAdresse(),0,1);
$pdf->Cell(40,5,$user->getCP().' '.$user->getVille(),0,1);
$pdf->Cell(40,5,$user->getNTel(),0,1);
$pdf->Ln(20);

$pdf->Cell(100);
$pdf->Cell(0,5,$patient->getNom().' '.$patient->getPrenom(),0,1);
$pdf->Cell(100);
$pdf->Cell(0,5,'Le '.$consultation->getDate());


$pdf->Ln(20);
foreach ($listetraitements as $traitement ){
    $pdf->Cell(0,10,$traitement->getDiagnostic(),0,1);
    $listeTraitementsMedicaments = $traitement->getsfTraitementMedicaments();
    foreach ($listeTraitementsMedicaments as $traitementMedicament ){
        $pdf->Cell(20);
        $pdf->Cell(0,5,$traitementMedicament->getsfMedicament()->getLibelle().' : '.$traitementMedicament->getQtePosologie().' pendant '.$traitementMedicament->getDuree(),0,1);
    }
    $pdf->Ln(15);
    if($traitement->countsfChirurgies() > 0){
        $listeChirurgies = $traitement->getsfChirurgies();
        $pdf->Cell(0,10,'Chirurgies:',0,1);
        foreach ($listeChirurgies as $chirurgie ){
            $pdf->Cell(20);
            $pdf->Cell(0,5,$chirurgie->getsfTypeChirurgie()->getLibelle(),0,1);
        }
    }
}
$pdf->Output();
?>
